products = [["iphone",6888],["MacPro",14800],["小米6",2499],["Coffee",31],["Book",60],["Nike",699]]
print("商品列表".center(10,'-'))
for i in products:
    print(i[0]+"\t"+str(i[1]))
shop_car = []
shop_cost = []
while True:
    no = input("请输入商品编号1-6,按q退出:")
    if no == 'q':
        print("已购买商品列表".center(10,'-'))
        for i in shop_car:
            print(i)

        break
    else:
        if int(no) > 0 and int(no) <= 6:
            shop_car.append(products[int(no)-1][0])
            shop_cost.append(products[int(no)-1][1])
            print(products[int(no)-1][0])
        else:
            print("请输入正确编号")

# 编号最好也添加下哈，逻辑是ok的，考虑下字典+列表的存储方式